package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(255);not null" json:"username"`
	Password string `gorm:"type:varchar(255);not null" json:"password"`
}

type Movie struct {
	gorm.Model
	Title     string `gorm:"type:varchar(255);not null" json:"title"`
	Content   string `gorm:"type:text;not null" json:"content"`
	Img       string `gorm:"type:varchar(255);not null" json:"img"`
	LikeCount int    `gorm:"type:int" json:"like_count"`
	UserID    int    `gorm:"type:int" json:"user_id"`
	User      User   `gorm:"foreignKey:UserID" json:"user"`
}
type Like struct {
	gorm.Model
	UserID  int   `gorm:"type:int" json:"user_id"`
	User    User  `gorm:"foreignKey:UserID" json:"user"`
	MovieID int   `gorm:"type:int" json:"movie_id"`
	Movie   Movie `gorm:"foreignKey:MovieID" json:"movie"`
}
